@extends('admin.layouts.default')

{{-- Content --}}
@section('content')
<!-- Tabs -->
<ul class="nav nav-tabs">
    <li class="active"><a href="#tab-general" data-toggle="tab">{{{ Lang::get('admin/general.general_info') }}}</a></li>
</ul>
<!-- ./ tabs -->

{{-- Create Form --}}
<form class="form-horizontal" method="post" action="@if (isset($culture)){{ URL::to('admin/infos/' . $culture->id . '/edit') }}@endif" autocomplete="off">
    <!-- CSRF Token -->
    <input type="hidden" name="_token" value="{{{ csrf_token() }}}" />
    <!-- ./ csrf token -->

    <!-- Tabs Content -->
    <div class="tab-content">
        <!-- General tab -->
        <div class="tab-pane active" id="tab-general">
            <!-- culture_name -->
            <div class="form-group {{{ $errors->has('culture_name') ? 'error' : '' }}}">
                <label class="span2 control-label" for="culture_name">{{{ Lang::get('admin/infos/table.culture_name') }}}</label>
                <div class="span6">
                    <input class="form-control" type="text" name="culture_name" id="culture_name" value="{{{ Input::old('culture_name', isset($culture) ? $culture->culture_name : null) }}}" />
                    {{ $errors->first('culture_name', '<span class="help-inline">:message</span>') }}
                </div>
            </div>
            <!-- ./ culture_name -->

            <!-- culture_content -->
            <div class="form-group {{{ $errors->has('culture_content') ? 'error' : '' }}}">
                <label class="span2 control-label" for="culture_content">{{{ Lang::get('admin/infos/table.culture_content') }}}</label>
                <div class="span6">
                    <textarea class="form-control ckeditor" cols="80" id="culture_content" name="culture_content" rows="10">
            {{{ Input::old('culture_content', isset($culture) ? $culture->culture_content : null) }}}
                    </textarea>
                    {{ $errors->first('culture_content', '<span class="help-inline">:message</span>') }}
                </div>
            </div>
            <!-- ./ culture_content -->

            <!-- freeze -->
            <div class="form-group {{{ $errors->has('freeze') || $errors->has('freeze') ? 'error' : '' }}}">
                <label class="span2 control-label" for="freeze">{{{ Lang::get('admin/infos/table.freeze') }}}?</label>
                <div class="span6">
                    @if ($mode == 'create')
                    <select class="form-control" name="freeze" id="freeze">
                        <option value="1"{{{ (Input::old('freeze', 0) === 1 ? ' selected="selected"' : '') }}}>{{{ Lang::get('general.yes') }}}</option>
                        <option value="0"{{{ (Input::old('freeze', 0) === 0 ? ' selected="selected"' : '') }}}>{{{ Lang::get('general.no') }}}</option>
                    </select>
                    @else
                    <select class="form-control" name="freeze" id="freeze">
                        <option value="1"{{{ ($culture->freeze ? ' selected="selected"' : '') }}}>{{{ Lang::get('general.yes') }}}</option>
                        <option value="0"{{{ ( ! $culture->freeze ? ' selected="selected"' : '') }}}>{{{ Lang::get('general.no') }}}</option>
                    </select>
                    @endif
                    {{ $errors->first('freeze', '<span class="help-inline">:message</span>') }}
                </div>
            </div>
            <!-- ./ freeze -->
        </div>
        <!-- ./ general tab -->

    </div>
    <!-- ./ tabs content -->

    <!-- Form Actions -->
    <div class="form-group">
        <div class="span6 offset2">
            <a type="reset" class="btn btn-default" href="{{{ URL::to('admin/infos') }}}">{{{ Lang::get('button.return') }}}</a>
            <button type="submit" class="btn btn-success">{{{ Lang::get('button.submit') }}}</button>
        </div>
    </div>
    <!-- ./ form actions -->
</form>
@stop
{{-- Scripts --}}
@section('scripts')
<script type="text/javascript">
    var imageUploadUrl = "{{{ URL::to('admin/images/upload') }}}" + "?_token={{{ csrf_token() }}}";
</script>
<script type="text/javascript" src="{{asset('assets/ckeditor/ckeditor.js') }}"></script>
@stop